
// line 6 of this test triggers semicolon insertion; this fucks up "$tree.text" syntax in ANTLR grammar. test that variable declarations are detected propertly
doTest([
'({\n\
    replace: function() {\n\
        var programName, first, last, text;\n\
        if (arguments.length===3) {\n\
            programName = trs.DEFAULT_PROGRAM_NAME;\n\
        } if (arguments.length===4) {\n\
            programName = arguments[0];\n\
        }\n\
    },\n\
    \n\
    getLastRewriteTokenIndex: function(programName) {\n\
        programName = programName || trs.DEFAULT_PROGRAM_NAME;\n\
    },\n\
    \n\
    getProgram: function(name) {\n\
        var is = this.programs[name];\n\
        if ( !is ) {\n\
            is = this.initializeProgram(name);\n\
        }\n\
    },\n\
    \n\
    initializeProgram: function(name) {\n\
        var is = [];\n\
    },\n\
    \n\
    toOriginalString: function(start, end) {\n\
        if (!org.antlr.lang.isNumber(start)) {\n\
            start = trs.MIN_TOKEN_INDEX;\n\
        }\n\
        if (!org.antlr.lang.isNumber(end)) {\n\
            end = this.size()-1;\n\
        }\n\
	  \n\
        var buf = [], i;\n\
        for (i=start; i>=trs.MIN_TOKEN_INDEX && i<=end && i<this.tokens.length; i++) {\n\
            buf.push(this.get(i).getText());\n\
        }\n\
        return buf.join("");\n\
    }\n\
});'
], []);
